﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmBuscarLaboratorio.aspx.cs" Inherits="Farmacia.net.Compras.Laboratorios.frmBuscarLaboratorio" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style3
        {
            width: 100%;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <fieldset>
        <table class="style3">
            <tr>
                <td width="250px" align="right">
        Buscar Laboratorio:</td>
                <td width="250px">
        <asp:TextBox ID="txtNombre" runat="server" Width="235px"></asp:TextBox>
                </td>
                <td>
        <asp:ImageButton ID="btnBuscar" runat="server" Text="Buscar" 
                        ImageUrl="~/Images/1340835453_file_search.png" ToolTip="Buscar" Width="20px" />
                </td>
                <td>
                    &nbsp;</td>
                <td align="right">
                    <asp:ImageButton ID="frmNuevoLab" runat="server" 
                        PostBackUrl="~/Compras/Laboratorio/frmRegistrarLaboratorio.aspx?acc=nuevo" 
                        Height="25px" ImageUrl="~/Images/1341013935_laboratory.png" Width="25px" 
                        ToolTip="Nuevo Laboratorio" />
                </td>
            </tr>
        </table>
    </fieldset>
<fieldset>
<legend>Listador de Laboratorio 
    </legend>
    <asp:Label ID="lblMensaje" runat="server" Font-Bold="True" ForeColor="Red" />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" DataSourceID="odsLaboratorio" GridLines="None" 
        DataKeyNames="idLaboratorio" Font-Overline="False" 
        Font-Strikeout="False" ForeColor="#333333" onrowcommand="GridView1_RowCommand" 
        Width="100%">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:BoundField DataField="IdLaboratorio" HeaderText="Id" 
                SortExpression="IdLaboratorio" >
            <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px" />
            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
            </asp:BoundField>
            <asp:HyperLinkField DataNavigateUrlFields="IdLaboratorio" 
                DataNavigateUrlFormatString="frmRegistrarLaboratorio.aspx?acc=ver&amp;idLaboratorio={0}" 
                DataTextField="Nombre" HeaderText="Nombre" SortExpression="Nombre" 
                Text="Nombre">
            <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="300px" />
            <ItemStyle Font-Bold="True" HorizontalAlign="Left" VerticalAlign="Middle" 
                Width="300px" />
            </asp:HyperLinkField>
            <asp:BoundField DataField="Referencia" HeaderText="Referencia" 
                SortExpression="Referencia" >

            <ControlStyle Width="280px" />
            </asp:BoundField>

            <asp:ButtonField CommandName="Eliminar" HeaderText="Eliminar" Text="Eliminar" 
                ButtonType="Image" ImageUrl="~/Images/1340873477_Delete.png" >
            <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Height="20px" 
                Width="20px" />
            </asp:ButtonField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:ImageButton ID="ImageButton1" runat="server" Height="20px" 
                        ImageUrl="~/Images/1340864176_file_edit.png" Width="20px"
                        PostBackUrl='<%# Eval("IdLaboratorio","frmRegistrarLaboratorio.aspx?acc=editar&amp;IdLaboratorio={0}") %>' ToolTip="Editar" 
                         />
                </ItemTemplate>
                <ItemStyle Width="30px" />
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:ImageButton CommandName='Eliminar' ID="ImageButton2" 
                        Text="Delete" runat="server" Height="20px" 
                        ImageUrl="~/Images/1340873477_Delete.png" Width="20px" 
                        OnClientClick="confirm('Desea Eliminar el Laboratorio');" CausesValidation="False" 
                        PostBackUrl='<%# Eval("IdLaboratorio","frmRegistrarLaboratorio.aspx?acc=eliminar&IdLaboratorio={0}") %>' 
                        ToolTip="Eliminar" 
                        />
                </ItemTemplate>
                <ItemStyle Width="30px" />
            </asp:TemplateField>
        </Columns>
        <EditRowStyle BackColor="#999999" />
        <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#E9E7E2" />
        <SortedAscendingHeaderStyle BackColor="#506C8C" />
        <SortedDescendingCellStyle BackColor="#FFFDF8" />
        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
    </asp:GridView>


    <asp:ObjectDataSource ID="odsLaboratorio" runat="server" 
        onobjectcreating="odsLaboratorio_ObjectCreating" 
        SelectMethod="GetFromLaboratorioByNombre" 
        TypeName="Farmacia.BussinessLogic.Almacen.Laborat.LaboratorioBL" 
        ondeleted="odsLaboratorio_Deleted" ondeleting="odsLaboratorio_Deleting">
        <SelectParameters>
            <asp:ControlParameter ControlID="txtNombre" DefaultValue="%" Name="nombre" 
                PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>

    </fieldset>
</asp:Content>
